home *** CD-ROM | disk | FTP | other *** search
- ; Author: M. Steven Baker
- ; Date: July 29, 1986
- ;
- ; long time18(0) -- returns timer counter in 18.2 counts/second
- ; long time18(long * loc) -- also stores timer count in loc
- ;
- ; Version of Time() for Intel Fortran to emulate UNIX time()
- ; returns timer interrupt count from BIOS data area
- ; count = 18.2 ticks per second
- ; this version set up for Intel Fortran-86
- ;
-
- DATA segment at 40h
- org 6ch
- timer_low label word
- org 6eh
- timer_high label word
- DATA ends
-
-
- SUBPRG_CODE SEGMENT
-
- ;
- public TIME18
- assume cs:SUBPRG_CODE,ds:DATA
- ;
- TIME18 proc far
- push ds ;save DS
- mov ax,40h ;point to ROM BIOS area
- mov ds,ax
- cli ;shut off interrupts
- mov ax,timer_low ;timer_low
- mov dx,timer_high ;timer_high
- sti
- pop ds
- ret
-
- TIME18 endp
- SUBPRG_CODE ends
-
- end
-